fix: Align context bundle traversal with effective-dep-graph semantics#85
Open
ulascanzorer wants to merge 2 commits into
Open
fix: Align context bundle traversal with effective-dep-graph semantics#85ulascanzorer wants to merge 2 commits into
ulascanzorer wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Task Reference: [MYMR-207]
The three context-bundle builders (
buildAgentContext,buildPlanningContext,buildReviewContext) built their Prerequisites and Downstream sections from raw recursive CTEs (getDependencyChain,getDownstreamTx) that predated the cancelled-transparent semanticsbuildEffectiveDepGraphalready enforces for the analyze tools. As a result bundles listed cancelled tasks as prerequisites/dependents, and a cancelled middle on adepends_onpath burned a depth slot so the real active blocking wall was never reached inside themaxDepth=2budget (A -> B(cancelled) -> C(active)showedBat depth 1 and never reachedC).This change derives prerequisites and downstream from a depth-bounded walk over the effective graph so the four analyze tools and the three context bundles agree semantically for the same task:
listTasksForGraph+listDependsOnEdges+ adjacency build) into a new exportedbuildDepAdjacencyinlib/graph/effective-deps.ts, and refactoredbuildEffectiveDepGraphto call it (behaviour unchanged;getBlockedTasks/getCriticalPath/deriveTaskStatesSlimsee no difference).walkEffectiveDepsBounded: a BFS-by-effective-depth walk where cancelled tasks are transparent and depth-free, capped at the bundle budget of depth 2.agent.ts/planning.ts/review.tsoffgetDependencyChain/getDownstreamTxonto onebuildDepAdjacencycall plus forward (prerequisites) and reverse (downstream) bounded walks.lib/data/traversal.tsis untouched; its other callers (getDownstream,edge.tscycle detection) are unaffected.Type of change
Testing
bun run devbun run lint)bun run typecheck)Full
bun testsuite green (461 pass, 0 fail). Added a cancelled-middle transparency integration test to each oftests/context/agent.test.ts,tests/context/planning.test.ts,tests/context/review.test.tsasserting C surfaces and B (cancelled) does not.Notes for reviewer
mymir_analyze type='downstream'(getDownstream->getDownstreamTx->fetchDownstream) still uses the raw cancelled-blind CTE and carries the same bug class. Left for a separate task per MYMR-207 scope; no change togetDownstream/getDownstreamTx/fetchDownstream/tool-handlers.tshere.